<app-horizontal-grid [cols]="5" [displayCols]="5">
  <!--指令所在的元素叫宿主-->
  <span appGridItem *ngFor="let item of tabItems; let idx = index;">
    <img 
      [src]="selectedIndex === idx ? item.selectedIcon : item.icon" 
      alt="" 
      [appGridItemImage]="'2rem'" 
      [fitMode]="'cover'"
      (click) = "toggleSelectedTab(idx)"
    />
    <span appGridItemTitle="0.5rem">{{ item.title }}</span>
  </span>
</app-horizontal-grid>